package com.zy.swagger.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * description 项目常量类
 *
 * @author ZY
 * @date 2021年03月31日 00:39
 **/

public class ProjectConstant {

    public static final String SESSION_CODE_KEY = "verifyCode";

    public static final String ENV_LOCAL = "local";

    public static final String ENV_DEV = "dev";

    public static final String ENV_TEST = "test";

    public static Map<String, String> envMap = new HashMap<>();

    /**
     * mysql实例连接URL模板串
     */
    public static final String MYSQL_INSTANCE_URL = "jdbc:mysql://%s:%s?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&user=%s&password=%s";

    /**
     * mysql数据库连接URL模板串
     */
    public static final String MYSQL_DB_URL = "jdbc:mysql://%s:%s/%s?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&user=%s&password=%s";


    public static Map<String, String> getEnvMap() {
        String local = "127.0.0.1";
        // TODO: 此处根据自身的开发、测试环境设置ip
        String dev = "10.200.0.3";
        String test = "10.200.0.4";
        envMap.put(ENV_LOCAL, local);
        envMap.put(ENV_DEV, dev);
        envMap.put(ENV_TEST, test);
        return envMap;
    }

}
